package com.lightdz.tshirtdz.general;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;


/**
 * 获取自定义环境变量的方法
 * Created by Administrator on 2018/12/29.
 */
@Configuration
public class EnvironmentConfig {
    @Autowired
    Environment environment;

    public String getPort() {
        return environment.getProperty("server.port", "8080");
    }

    public String getRootRoute() {
        return environment.getProperty("server.servlet.context-path", "/tshirt");
    }

}
